Public Class Table_Factory
    Public Enum SORT As Integer
        DATE_ASC = 1
        DATE_DESC = 2
        VER_ASC = 3
        VER_DESC = 4
        NAME_ASC = 5
        NAME_DESC = 6
    End Enum

    Public Function GetAllTablesForDatabase( _
                            ByVal lDatabaseID As Long, _
                            Optional ByVal lSort As SORT = SORT.NAME_ASC) As Collection

        Dim oFactory As New DBTable_Factory
        Return oFactory.GetAllTablesForDatabase(lDatabaseID, lSort)
    End Function

    Public Function GetAllTablesForDatabase( _
                            ByVal lDatabaseID As Long, _
                            ByVal lDatabaseRevID As Long, _
                            Optional ByVal lSort As SORT = SORT.NAME_ASC) As Collection

        Dim oFactory As New DBTable_Factory
        Return oFactory.GetAllTablesForDatabase(lDatabaseID, lDatabaseRevID, lSort)
    End Function

    Public Function GetAllTablesForDatabase( _
                ByVal lDatabaseID As Long, _
                ByVal sStartDate As String, _
                ByVal sEndDate As String, _
                ByVal lSort As Table_Factory.SORT) As Collection

        Dim oFactory As New DBTable_Factory
        Return oFactory.GetAllTablesForDatabase(lDatabaseID, sStartDate, sEndDate, lSort)
    End Function

    Public Function GetTableByName( _
                        ByVal lDatabaseID As Long, _
                        ByVal lOwnerID As Long, _
                        ByVal sTable As String) As SQLAutoDocLib.Table

        Dim oFactory As New DBTable_Factory
        Return oFactory.GetTableByName(lDatabaseID, lOwnerID, sTable)
    End Function

    Public Function GetAllTableRevs( _
        ByVal lTableID As Long) As ArrayList

        Dim oFactory As New DBTable_Factory
        Return oFactory.GetAllTableRevs(lTableID)
    End Function

    Public Function FindTables( _
        ByVal lServerID As Long, _
        ByVal lDatabaseID As Long, _
        ByVal sStartDate As String, _
        ByVal sEndDate As String, _
        ByVal sSearchText As String, _
        ByVal bIncludeColumns As Boolean) As ArrayList

        Dim oFactory As New DBTable_Factory
        Return oFactory.FindTables(lServerID, lDatabaseID, sStartDate, sEndDate, sSearchText, bIncludeColumns)
    End Function

    Public Function CountOfActiveTablesForDatabase(ByVal lDatabaseID As Long)
        Dim oFactory As New DBTable_Factory
        Return oFactory.CountOfActiveTablesForDatabase(lDatabaseID)
    End Function
End Class
